<?php

namespace app\shop\controller;

// 框架基础控制类
use think\Controller;

class Product extends Controller
{
    //构造函数
    public function __construct()
    {
        //手动把父类的方法获取过来
        parent::__construct();

        // check_cors_request();

        // 全局用户模型
        $this->BusinessModel = model('Business.Business');
        $this->RecordModel = model('Business.Record');
        $this->ProductModel = model('Product.Product');
    }

    public function list()
    {
        $result =  $this->ProductModel->order('id DESC')->paginate(10,false,['query' =>Request::instance()->param()]);

        if(count($result) > 0)
        {
            $this->success('返回文章列表', null, $result);
        }else
        {
            $this->error('没有更多数据', null, []);
        }
    }
}